<extend name="zh_tw:Public:base" />
<block name="title">
    <title>經銷商主頁 - 客棧管理</title>
</block>
<block name="extendHead">
    <link rel="stylesheet" type="text/css" href="/Public/dist/Home/common_control.css?rev=65393a524028c7e3b76e961a08059c7d">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/jslib/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" />
    <link rel="stylesheet" type="text/css" media="all" href="__PUBLIC__/jslib/bootstrap-daterangepicker/daterangepicker.css" />
    <link rel="stylesheet" type="text/css" href="/Public/dist/Home/DealerManagePage/index.css"/>
</block>
<block name="document">
    <div id="doc" class="container-above-md">
       <include file="zh_tw:Public:Include_dealer_control_navbar" navbar-menu-setting="active" />
        <div id="doc-body" class="row">
            <include file="zh_tw:Public:Include_dealer_setting_side" doc-side-book="active" />
            <div id="doc-center">
                <div class="content-panel">
                    <div class="content-panel-header">
                        <div class="content-panel-title">客棧管理</div>
                        <div class="content-panel-operation">
                            <div class="btn-raised btn-sm btn-primary" data-toggle="modal" data-target="#addModal">申請客棧</div>
                        </div>
                        <div class="content-panel-operation" style="padding-right: 10px">
                            <div class="btn-raised btn-sm btn-primary addHotel" data-toggle="modal" data-target="#addHotelModal">添加認證客棧</div>
                        </div>
                        <div class="content-panel-operation" style="padding-right: 10px">
                            <div class="btn-raised btn-sm btn-primary addCharity" data-toggle="modal" data-target="#addHotelModal">添加義賣客棧</div>
                        </div>
                    </div>
                    <include file="zh_tw:Public:Include_content_loading" loading-container-id="loading" />
                    <div class="content-panel-body" style="padding: 16px;">
                        <table class="table content-panel-table" id="accounts-table">
                            <thead>
                                <tr>
                                    <th>客棧名</th>
                                    <th>客棧聯系人</th>
                                    <th>聯系電話</th>
                                    <th>狀態</th>
                                    <th>結束年限</th>
                                    <th>操作</th>
                                </tr>
                                <tr></tr>
                            </thead>
                            <tbody>
                                <volist name="hotelApply" id="vo">
                                    <tr class="first-tr">
                                        <td tag="name" class="col-xs-2">{$vo.hotelname}</td>
                                        <td tag="authority" class="col-xs-2">{$vo.username}</td>
                                        <td tag="mobile" class="col-xs-2">{$vo.mobile}</td>
                                        <td tag="status" class="col-xs-2 status-hide">
                                            <switch name="vo.status">
                                                <case value="0"><span style="color:red">待審核</span></case>
                                                <case value="2"><span>已拒絕</span></case>
                                            </switch>
                                        </td>
                                        <td tag="ages" class="col-xs-2">-</td>
                                        <td class="col-xs-2">
                                            <if condition="$vo.status eq 2">
                                                <div tag="operation" style="width: 30px;" value='0' data-value='7' class="btn-link again-btn" data-json='{:json_encode($vo);}'>編輯</div>
                                            </if>
                                        </td> 
                                    </tr>
                                </volist>
                                <volist name="dealerAdmin" id="vo">
                                    <if condition="$vo.enddate lt date('Y-m-d')">
                                        <tr class="first-tr status-gray">
                                            <td tag="name" class="col-xs-2">{$vo.name}</td>
                                            <td tag="authority" class="col-xs-2">{$vo.username}</td>
                                            <td tag="mobile" class="col-xs-2">{$vo.mobile}</td>
                                            <td tag="status" class="col-xs-2 status-hide">已分配</td>
                                            <td tag="ages" class="col-xs-2 enddate">{$vo.enddate}</td>
                                            <td class="col-xs-2">
                                                <div tag="operation" value='0' data-value="{$vo.id}" class="btn-link switch-btn">
                                                    <span status="1">啟用</span>
                                                </div>
                                            </td> 
                                         </tr>
                                         <tr style="display: none;" class="second-tr status-gray">
                                            <td colspan="2"><span class="next-tr" tag="area">{$vo.cityname}-{$vo.areaname}</span></td>
                                            <td colspan="1">
                                                <span class="next-tr" tag="area">
                                                    {$vo.createdate|substr=0,10}-<span class="enddate">{$vo.enddate}</span>
                                                </span>
                                            </td>
                                            <td colspan="2"><span class="next-tr changeYearsModal" style="display: none;" data-toggle="modal" tag="area" data-target="#changeYearsModal" data-value = "{$vo.id}" data-end = '{$vo.enddate}' data-start = '{$vo.createdate|substr=0,10}'>修改結束年限</span></td>
                                            <td colspan="3"><span class="next-tr" >&nbsp;</span><p class="close-tr">關閉</p></td>
                                        </tr> 
                                    <else />
                                        <tr class="first-tr">
                                            <td tag="name" class="col-xs-2">{$vo.name}</td>
                                            <td tag="authority" class="col-xs-2">{$vo.username}</td>
                                            <td tag="mobile" class="col-xs-2">{$vo.mobile}</td>
                                            <td tag="status" class="col-xs-2 status-hide">已分配</td>
                                            <td tag="ages" class="col-xs-2 enddate">{$vo.enddate}</td>
                                            <td class="col-xs-2">
                                                <div tag="operation" style="width: 30px;" value='0' data-value="{$vo.id}" class="btn-link switch-btn" >
                                                    <span status="0" style="color:red;">停用</span>
                                                </div>
                                            </td> 
                                        </tr> 
                                        <tr style="display: none;" class="second-tr">
                                            <td colspan="2"><span class="next-tr" tag="area">{$vo.cityname}-{$vo.areaname}</span></td>
                                            <td colspan="1">
                                                <span class="next-tr" tag="area">
                                                    {$vo.createdate|substr=0,10}-<span class="enddate">{$vo.enddate}</span>
                                                </span>
                                            </td>
                                            <td colspan="2"><span class="next-tr changeYearsModal" data-toggle="modal" tag="area" data-target="#changeYearsModal" data-value = "{$vo.id}" data-end = '{$vo.enddate}' data-start = '{$vo.createdate|substr=0,10}'>修改結束年限</span></td>
                                            <td colspan="3"><span class="next-tr" >&nbsp;</span><p class="close-tr">關閉</p></td>
                                        </tr>
                                    </if>
                                </volist>
                            </tbody>
                        </table>
                        <div id="orderListBodyEmpty" class="typo-text-black-light typo-subhead hidden">沒有找到客棧</div>
                    </div>
                    <div id="pagFooter" class="content-panel-footer" >
                        <div class="pull-right">
                            {$page}
                        </div>
                        <!-- <div class="pull-right content-panel-pagination-info">共有&nbsp;<span class="text-accent">{$pageInfo.total}</span>&nbsp;條記錄，總頁數：&nbsp;<span class="text-accent">{$pageInfo.pageTotal}</span>
                        </div> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--end of doc-->
    <!--添加客棧模态框-->
    <div class="modal fade" data-backdrop="static" id="addModal">
        <div class="modal-dialog sm-width">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div class="modal-title">
                        申請客棧
                    </div>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form-sm" id="accountAdd-container">
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧名:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="hotelName" autocomplete="off" maxlength="20" placeholder="請輸入客棧名" value="">
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">聯系人:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="contact-person" autocomplete="off" maxlength="20" placeholder="請輸入聯系人" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">聯系號碼:</label>
                            <div class="col-xs-6">
                                <include file="zh_tw:Public:Include_area_code" style=''  />
                                <input type="text" class="form-control" id="contact-num" autocomplete="off" maxlength="11" placeholder="請輸入聯系號碼" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧地址:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="address" autocomplete="off" maxlength="50" placeholder="請輸入客棧地址" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧時區:</label>
                            <div class="col-xs-9">
                                <select class="form-control" id="addRequestUniversalTime">
                                    <volist name="universalTimeList" id="universalTime">
                                        <option value="{$universalTime.universalTimeId}"  data-areacode="{$universalTime.areaCode}" data-countryid="{$universalTime.countryId}">({$universalTime.universalTimeUtc}){$universalTime.universalTimeName}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">多元貨幣:</label>
                            <div class="col-xs-9">
                                <select class="form-control" id="addRequestMultiCurrency">
                                    <volist name="currencyInfo" id="currency">
                                        <option value="{$currency.id}">({$currency.standsymbol}) {$currency.name}/{$currency.usname} . {$currency.symbol}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">所在城市:</label>
                            <div class="col-xs-8 cityContainer" id="cityContainerApply">
                                <div class="tag-selected-container">
                                </div>
                                <div class="tag-avaliable-container">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">所在區域:</label>
                            <div class="col-xs-8 districtContainer" id="districtContainerApply">
                                <div class="tag-selected-container">
                                </div>
                                <div class="tag-avaliable-container">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <div class="form-horizontal form-sm">
                        <div class="form-group">
                            <div class="col-xs-10 col-xs-offset-2">
                                <div class="help-block inline-help-block inline-help-block-right"></div>
                                <button type="button" class="btn-sm btn-primary btn-raised" id="submitAdd">確定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
    <!--編輯模态框-->
    <div class="modal fade" data-backdrop="static" id="againModal">
        <div class="modal-dialog sm-width">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div class="modal-title">編輯客棧</div>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form-sm" id="again-accountAdd-container">
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧名:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="again-hotelName" autocomplete="off" maxlength="20" placeholder="請輸入客棧名" value="">
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧地址:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="again-address" autocomplete="off" maxlength="50" placeholder="請輸入客棧地址" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">聯系人:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="again-contact-person" autocomplete="off" maxlength="20" placeholder="請輸入聯系人" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">聯系號碼:</label>
                            <div class="col-xs-6">
                                <input type="text" class="form-control" id="again-contact-num" autocomplete="off" maxlength="11" placeholder="請輸入聯系號碼" value="" />
                            </div>
                            <div class="col-xs-3">
                                <div class="help-block"></div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <div class="form-horizontal form-sm">
                        <div class="form-group">
                            <div class="col-xs-10 col-xs-offset-2">
                                <div class="help-block inline-help-block inline-help-block-right"></div>
                                <button type="button" class="btn-sm btn-primary btn-raised" id="submitAgain">重新審核</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>     
    <!--添加客棧的模态框-->
    <div class="modal fade" data-backdrop="static" id="addHotelModal">
        <div class="modal-dialog sm-width">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <div class="modal-title">
                        添加客棧
                        <small style="color: red;">(為已經申請成功的掌櫃添加客棧)</small>
                    </div>
                </div>
                <div class="modal-body">
                    <form id='' class="form-horizontal form-sm">
                        <div class="form-group">
                            <label class="col-xs-3 control-label">手機號碼:</label>
                            <div class="col-xs-5">
                                <include file="zh_tw:Public:Include_area_code" style=''  />
                                <input type="text" class="form-control" id="user-mobile" autocomplete="off" maxlength="11" placeholder="請輸入屬於您管理的號碼" value="" />
                            </div>
                            <div class="col-xs-4">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧名稱:</label>
                            <div class="col-xs-5">
                                <input type="text" class="form-control" id="user-hotel" autocomplete="off" placeholder="請輸入客棧名稱" value="" />
                            </div>
                            <div class="col-xs-4">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">客棧時區:</label>
                            <div class="col-xs-9">
                                <select class="form-control" id="addHotelRequestUniversalTime">
                                    <volist name="universalTimeList" id="universalTime">
                                        <option value="{$universalTime.universalTimeId}"  data-areacode="{$universalTime.areaCode}">({$universalTime.universalTimeUtc}){$universalTime.universalTimeName}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">多元貨幣:</label>
                            <div class="col-xs-9">
                                <select class="form-control" id="addHotelRequestMultiCurrency">
                                    <volist name="currencyInfo" id="currency">
                                        <option value="{$currency.id}">({$currency.standsymbol}) {$currency.name}/{$currency.usname} . {$currency.symbol}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">到期時間:</label>
                            <input type="hidden" class="form-control" id="communityNo" value="" />
                            <input type="hidden" class="form-control" id="masterentityId" value="" />
                            <div class="col-xs-5">
                                <input type="text" class="form-control" id="hotel-enddate" autocomplete="off" maxlength="10" placeholder="請輸入到期時間" value="{$enddate}" />
                            </div>
                            <div class="col-xs-4">
                                <div class="help-block"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">所在城市:</label>
                            <div class="col-xs-8 cityContainer" id="cityContainer">
                                <div class="tag-selected-container">
                                </div>
                                <div class="tag-avaliable-container">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">所在區域:</label>
                            <div class="col-xs-8 districtContainer" id="districtContainer">
                                <div class="tag-selected-container">
                                </div>
                                <div class="tag-avaliable-container">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <div class="form-horizontal form-sm">
                        <div class="form-group">
                            <div class="col-xs-11 col-xs-offset-1">
                                <div class="help-block inline-help-block inline-help-block-right"></div>
                                <small class="hidden tipsmall" style="color: red;"> (美住工作人員會盡快為您審核)</small>
                                <button type="button" class="btn-sm btn-primary btn-raised" id="submitAddHotel">確定</button>
                                <!--<button type="button" class="btn-sm btn-primary btn-raised" id="submitAddCharity">添加義賣客棧</button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--修改年限模态框-->
    <div class="modal fade" data-backdrop="static" id="changeYearsModal">
        <div class="modal-dialog sm-width" style="width: 400px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="btn close" data-dismiss="modal" >
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <div class="modal-title">修改年限</div>
                </div>
                <div class="modal-body" style="padding-left:30px ;">
                    <div class="year-word">
                    	<span>開始年限</span>
                    	<span>結束年限</span>
                    </div>
                    <div class="year-checked">
                        <input style="color: #C1C1C1;" type="text" name="" id="datePickerInput-start" value="2016-12-12"  disabled="disabled" />
                        <span style="color:#e5e5e5 ;">——</span>
                        <span id="checkTime" class="iconfont icon-calendar"></span>
                        <input type="text" name="" id="datePickerInput" value="" enddate="{$enddate}"/>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="form-horizontal form-sm">
                        <div class="form-group">
                            <div class="col-xs-10 col-xs-offset-2">
                                <div class="help-block inline-help-block inline-help-block-right"></div>
                                <button type="button" class="btn-sm btn-primary btn-raised" id="changeTime">確認修改</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div> 
    <script type="text/html" id="templateHotelMessage">
        <tr class="first-tr">
            <td tag="name" class="col-xs-2"></td>
            <td tag="authority" class="col-xs-2"></td>
            <td tag="mobile" class="col-xs-2"></td>
            <td tag="status" class="col-xs-2 status-hide"></td>
            <td tag="ages" class="col-xs-2"></td>
            <td class="col-xs-2">
                <div tag="operation" style="width: 30px;" class="btn-link switch-btn"></div>
            </td> 
        </tr>
    </script>
    <script type="text/html" id="templateHotelMessage2">
        <tr style="display: none;" class="second-tr">
            <td colspan="2"><span class="next-tr" tag="address"></span><p style="margin-top: 20px;" tag="statr-ages"></p></td>
            <td colspan="3"><span class="next-tr" tag="area"></span><p data-toggle="modal" class="changeYearsModal" data-target="#changeYearsModal">修改結束年限</p></td>
            <td colspan="1"><span class="next-tr" >&nbsp;</span><p class="close-tr">關閉</p></td>
        </tr>
    </script>
</block>
<block name="extendFootJs">
    <script type="text/javascript" src="/Public/dist/Home/common_control.js?rev=3eaece6fb9364720bc065d082584c75d"></script>
    <script type="text/javascript" src="__PUBLIC__/jslib/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/jslib/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <script type="text/javascript" src="/Public/uclbrt/ulite/city/citylist_zh_tw.min.js?rev=eb037c4769250fbfbd6d87f2b5ba2e15"></script>
    <script type="text/javascript" src="/Public/dist/Home/DealerManagePage/index.js?rev=9c97b79dd28c289cd8cfcc536c99551d"></script>
</block>

